using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Collections.Generic;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

using Geekees.Common.Controls;

namespace Geekees.App.HRAssistant.Web
{
	public partial class Main : System.Web.UI.MasterPage
	{
		#region properties

		#region TempEnableIndicator

		private bool _tempEnableIndicator = false;

		public bool TempEnableIndicator
		{
			get { return _tempEnableIndicator; }
			set { _tempEnableIndicator = value; }
		}

		private bool _tempDisableIndicator = false;

		public bool TempDisableIndicator
		{
			get { return _tempDisableIndicator; }
			set { _tempDisableIndicator = value; }
		}



		#endregion

		#region EnableIndicator (bool)

		/// <summary>
		/// EnableIndicator
		/// </summary>
		public bool EnableIndicator
		{
			get
			{
				object o = ViewState["EnableIndicator"];
				return o == null ? true : (bool)o;
			}
			set
			{
				ViewState["EnableIndicator"] = value;
			}
		}

		#endregion

		#region EnableIndicatorString (string)

		/// <summary>
		/// EnableIndicatorString
		/// </summary>
		protected string EnableIndicatorString
		{
			get
			{
				if( this.TempEnableIndicator )
					return "true";

				if( this.TempDisableIndicator )
					return "false";

				return EnableIndicator ? "true" : "false";
			}
		}

		#endregion

		#endregion

		#region public methods

		public void SetTitle( string title )
		{
			//this.lTitle.Text = title;
		}

		/// <summary>
		/// if ajax.net is enabled
		/// </summary>
		public bool IsAjaxEnabled
		{
			get
			{
				ScriptManager sm = ScriptManager.GetCurrent( this.Page );
				if( sm == null )
					return false;

				return sm.EnablePartialRendering;
			}
		}

		public void DisableAjax()
		{
			ScriptManager sm = ScriptManager.GetCurrent( this.Page );
			if( sm == null )
				return;

			sm.EnablePartialRendering = false;
		}

		public string CurrentAppPath
		{
			get
			{
				return Request.ApplicationPath;
			}
		}

		#endregion

		#region event handler

		protected void Page_Load( object sender, EventArgs e )
		{

		}

		#endregion

		#region override methods

		protected override void OnInit( EventArgs e )
		{
			base.OnInit( e );

			//lVersion.Text = typeof( ASGridView ).Assembly.GetName().Version.ToString();

			List<string> codes = new List<string>();
			codes.Add( "en-GB" );
			codes.Add( "zh-CN" );
			this.aslASLanguage.LanguageCodes = codes;
		}

		#endregion
   
	}
}
